<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ESP32 HTTPS Server: httpsserver::WebsocketHandler Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP32 HTTPS Server
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classhttpsserver_1_1WebsocketHandler.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="classhttpsserver_1_1WebsocketHandler-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">httpsserver::WebsocketHandler Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a9a60cb5f4db6d0267b6114f06aa45116"><td class="memItemLeft" align="right" valign="top"><a id="a9a60cb5f4db6d0267b6114f06aa45116"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1WebsocketHandler.html#a9a60cb5f4db6d0267b6114f06aa45116">onClose</a> ()</td></tr>
<tr class="memdesc:a9a60cb5f4db6d0267b6114f06aa45116"><td class="mdescLeft">&#160;</td><td class="mdescRight">The default onClose handler. If no over-riding handler is provided for the "close" event, this method is called. <br /></td></tr>
<tr class="separator:a9a60cb5f4db6d0267b6114f06aa45116"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c0c9881bd80ec13215a64723d37f28d"><td class="memItemLeft" align="right" valign="top"><a id="a8c0c9881bd80ec13215a64723d37f28d"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1WebsocketHandler.html#a8c0c9881bd80ec13215a64723d37f28d">onMessage</a> (<a class="el" href="classhttpsserver_1_1WebsocketInputStreambuf.html">WebsocketInputStreambuf</a> *pWebsocketInputStreambuf)</td></tr>
<tr class="memdesc:a8c0c9881bd80ec13215a64723d37f28d"><td class="mdescLeft">&#160;</td><td class="mdescRight">The default onData handler. If no over-riding handler is provided for the "message" event, this method is called. A particularly useful pattern for using onMessage is: </p><div class="fragment"><div class="line">std::stringstream buffer;</div><div class="line">buffer &lt;&lt; pWebSocketInputRecordStreambuf;</div></div><!-- fragment --><p> This will read the whole message into the string stream. <br /></td></tr>
<tr class="separator:a8c0c9881bd80ec13215a64723d37f28d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a18f912105b6c238dadd1f2d771cff1bc"><td class="memItemLeft" align="right" valign="top"><a id="a18f912105b6c238dadd1f2d771cff1bc"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1WebsocketHandler.html#a18f912105b6c238dadd1f2d771cff1bc">onError</a> (std::string error)</td></tr>
<tr class="memdesc:a18f912105b6c238dadd1f2d771cff1bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">The default onError handler. If no over-riding handler is provided for the "error" event, this method is called. <br /></td></tr>
<tr class="separator:a18f912105b6c238dadd1f2d771cff1bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a0f8c9cc74e5c30d9b7f19573297ef0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1WebsocketHandler.html#a7a0f8c9cc74e5c30d9b7f19573297ef0">close</a> (uint16_t status=CLOSE_NORMAL_CLOSURE, std::string message=&quot;&quot;)</td></tr>
<tr class="memdesc:a7a0f8c9cc74e5c30d9b7f19573297ef0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close the Web socket.  <a href="#a7a0f8c9cc74e5c30d9b7f19573297ef0">More...</a><br /></td></tr>
<tr class="separator:a7a0f8c9cc74e5c30d9b7f19573297ef0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd6abd98390115112c1d3790c839bd5a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1WebsocketHandler.html#acd6abd98390115112c1d3790c839bd5a">send</a> (std::string data, uint8_t sendType=SEND_TYPE_BINARY)</td></tr>
<tr class="memdesc:acd6abd98390115112c1d3790c839bd5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data down the web socket See the WebSocket spec (RFC6455) section "6.1 Sending Data". We build a WebSocket frame, send the frame followed by the data.  <a href="#acd6abd98390115112c1d3790c839bd5a">More...</a><br /></td></tr>
<tr class="separator:acd6abd98390115112c1d3790c839bd5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2711aa6a22c4218596f30681a993b297"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1WebsocketHandler.html#a2711aa6a22c4218596f30681a993b297">send</a> (uint8_t *data, uint16_t length, uint8_t sendType=SEND_TYPE_BINARY)</td></tr>
<tr class="memdesc:a2711aa6a22c4218596f30681a993b297"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data down the web socket See the WebSocket spec (RFC6455) section "6.1 Sending Data". We build a WebSocket frame, send the frame followed by the data.  <a href="#a2711aa6a22c4218596f30681a993b297">More...</a><br /></td></tr>
<tr class="separator:a2711aa6a22c4218596f30681a993b297"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5a69ec59ae16c3a59ef96a4509b7213"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1WebsocketHandler.html#aa5a69ec59ae16c3a59ef96a4509b7213">closed</a> ()</td></tr>
<tr class="separator:aa5a69ec59ae16c3a59ef96a4509b7213"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a87e2bb2bb7e68d7ecfa37e60d532cc97"><td class="memItemLeft" align="right" valign="top"><a id="a87e2bb2bb7e68d7ecfa37e60d532cc97"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>loop</b> ()</td></tr>
<tr class="separator:a87e2bb2bb7e68d7ecfa37e60d532cc97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64383ed5635d7a60a273d2e0f741df32"><td class="memItemLeft" align="right" valign="top"><a id="a64383ed5635d7a60a273d2e0f741df32"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>initialize</b> (<a class="el" href="classhttpsserver_1_1ConnectionContext.html">ConnectionContext</a> *con)</td></tr>
<tr class="separator:a64383ed5635d7a60a273d2e0f741df32"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:ad7342f44202fddd1dce8bf3b35acd617"><td class="memItemLeft" align="right" valign="top"><a id="ad7342f44202fddd1dce8bf3b35acd617"></a>
static const int&#160;</td><td class="memItemRight" valign="bottom"><b>OPCODE_CONTINUE</b> = 0x00</td></tr>
<tr class="separator:ad7342f44202fddd1dce8bf3b35acd617"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa00959e07a6ac14cbc046adee7c83f15"><td class="memItemLeft" align="right" valign="top"><a id="aa00959e07a6ac14cbc046adee7c83f15"></a>
static const int&#160;</td><td class="memItemRight" valign="bottom"><b>OPCODE_TEXT</b> = 0x01</td></tr>
<tr class="separator:aa00959e07a6ac14cbc046adee7c83f15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8763e8b0b942d9dcb07d19e3e9dc1c14"><td class="memItemLeft" align="right" valign="top"><a id="a8763e8b0b942d9dcb07d19e3e9dc1c14"></a>
static const int&#160;</td><td class="memItemRight" valign="bottom"><b>OPCODE_BINARY</b> = 0x02</td></tr>
<tr class="separator:a8763e8b0b942d9dcb07d19e3e9dc1c14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5a77337e7becf3105abab9e51bc5c89"><td class="memItemLeft" align="right" valign="top"><a id="af5a77337e7becf3105abab9e51bc5c89"></a>
static const int&#160;</td><td class="memItemRight" valign="bottom"><b>OPCODE_CLOSE</b> = 0x08</td></tr>
<tr class="separator:af5a77337e7becf3105abab9e51bc5c89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76b290962c081fa9c26ae4e99dcb613f"><td class="memItemLeft" align="right" valign="top"><a id="a76b290962c081fa9c26ae4e99dcb613f"></a>
static const int&#160;</td><td class="memItemRight" valign="bottom"><b>OPCODE_PING</b> = 0x09</td></tr>
<tr class="separator:a76b290962c081fa9c26ae4e99dcb613f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a91f85ad6e82fc5c03b2b4a1cbc4a3973"><td class="memItemLeft" align="right" valign="top"><a id="a91f85ad6e82fc5c03b2b4a1cbc4a3973"></a>
static const int&#160;</td><td class="memItemRight" valign="bottom"><b>OPCODE_PONG</b> = 0x0a</td></tr>
<tr class="separator:a91f85ad6e82fc5c03b2b4a1cbc4a3973"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada2607efcffbafce8d9b406cb347f3bf"><td class="memItemLeft" align="right" valign="top"><a id="ada2607efcffbafce8d9b406cb347f3bf"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_NORMAL_CLOSURE</b> = 1000</td></tr>
<tr class="separator:ada2607efcffbafce8d9b406cb347f3bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacf6f36bd9413a143de77b3b833de1df"><td class="memItemLeft" align="right" valign="top"><a id="aacf6f36bd9413a143de77b3b833de1df"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_GOING_AWAY</b> = 1001</td></tr>
<tr class="separator:aacf6f36bd9413a143de77b3b833de1df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:accfe7656e1ff9f66f672f9d3bf107d26"><td class="memItemLeft" align="right" valign="top"><a id="accfe7656e1ff9f66f672f9d3bf107d26"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_PROTOCOL_ERROR</b> = 1002</td></tr>
<tr class="separator:accfe7656e1ff9f66f672f9d3bf107d26"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae29dabad61a779b106d571c8c6e882a"><td class="memItemLeft" align="right" valign="top"><a id="aae29dabad61a779b106d571c8c6e882a"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_CANNOT_ACCEPT</b> = 1003</td></tr>
<tr class="separator:aae29dabad61a779b106d571c8c6e882a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ab25dbed4723312885d676ce6dc8b20"><td class="memItemLeft" align="right" valign="top"><a id="a9ab25dbed4723312885d676ce6dc8b20"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_NO_STATUS_CODE</b> = 1005</td></tr>
<tr class="separator:a9ab25dbed4723312885d676ce6dc8b20"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9a022a5a1bb8bb9610ed7aa2b5fb8c2"><td class="memItemLeft" align="right" valign="top"><a id="af9a022a5a1bb8bb9610ed7aa2b5fb8c2"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_CLOSED_ABNORMALLY</b> = 1006</td></tr>
<tr class="separator:af9a022a5a1bb8bb9610ed7aa2b5fb8c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5ce294ad8cf2749e7edad5752b361c9"><td class="memItemLeft" align="right" valign="top"><a id="ad5ce294ad8cf2749e7edad5752b361c9"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_NOT_CONSISTENT</b> = 1007</td></tr>
<tr class="separator:ad5ce294ad8cf2749e7edad5752b361c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ed310864824599f09ca7975a8dc1bf9"><td class="memItemLeft" align="right" valign="top"><a id="a3ed310864824599f09ca7975a8dc1bf9"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_VIOLATED_POLICY</b> = 1008</td></tr>
<tr class="separator:a3ed310864824599f09ca7975a8dc1bf9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac47bd193125d1e635ae997e6514b7de7"><td class="memItemLeft" align="right" valign="top"><a id="ac47bd193125d1e635ae997e6514b7de7"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_TOO_BIG</b> = 1009</td></tr>
<tr class="separator:ac47bd193125d1e635ae997e6514b7de7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fe1f07285e81e5d006b255e0c4d778d"><td class="memItemLeft" align="right" valign="top"><a id="a7fe1f07285e81e5d006b255e0c4d778d"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_NO_EXTENSION</b> = 1010</td></tr>
<tr class="separator:a7fe1f07285e81e5d006b255e0c4d778d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32c631f919e7b1015828037d85887f6e"><td class="memItemLeft" align="right" valign="top"><a id="a32c631f919e7b1015828037d85887f6e"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_UNEXPECTED_CONDITION</b> = 1011</td></tr>
<tr class="separator:a32c631f919e7b1015828037d85887f6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:accb37d42467e5ee1c598b058006a6e61"><td class="memItemLeft" align="right" valign="top"><a id="accb37d42467e5ee1c598b058006a6e61"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_SERVICE_RESTART</b> = 1012</td></tr>
<tr class="separator:accb37d42467e5ee1c598b058006a6e61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a473d60aa61bc99f522a370e0699d0649"><td class="memItemLeft" align="right" valign="top"><a id="a473d60aa61bc99f522a370e0699d0649"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_TRY_AGAIN_LATER</b> = 1013</td></tr>
<tr class="separator:a473d60aa61bc99f522a370e0699d0649"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81ad7d5fc403a1ad72108734375f5af9"><td class="memItemLeft" align="right" valign="top"><a id="a81ad7d5fc403a1ad72108734375f5af9"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>CLOSE_TLS_HANDSHAKE_FAILURE</b> = 1015</td></tr>
<tr class="separator:a81ad7d5fc403a1ad72108734375f5af9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:accf43f51c8ecdf01526373bf14acbac0"><td class="memItemLeft" align="right" valign="top"><a id="accf43f51c8ecdf01526373bf14acbac0"></a>
static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><b>SEND_TYPE_BINARY</b> = 0x01</td></tr>
<tr class="separator:accf43f51c8ecdf01526373bf14acbac0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a376011ffa9decf8083650d41fe13596f"><td class="memItemLeft" align="right" valign="top"><a id="a376011ffa9decf8083650d41fe13596f"></a>
static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><b>SEND_TYPE_TEXT</b> = 0x02</td></tr>
<tr class="separator:a376011ffa9decf8083650d41fe13596f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a7a0f8c9cc74e5c30d9b7f19573297ef0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7a0f8c9cc74e5c30d9b7f19573297ef0">&#9670;&nbsp;</a></span>close()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void httpsserver::WebsocketHandler::close </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>status</em> = <code>CLOSE_NORMAL_CLOSURE</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>message</em> = <code>&quot;&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Close the Web socket. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">status</td><td>The code passed in the close request. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">message</td><td>A clarification message on the close request. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aa5a69ec59ae16c3a59ef96a4509b7213"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5a69ec59ae16c3a59ef96a4509b7213">&#9670;&nbsp;</a></span>closed()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool httpsserver::WebsocketHandler::closed </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns true if the connection has been closed, either by client or server </p>

</div>
</div>
<a id="acd6abd98390115112c1d3790c839bd5a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acd6abd98390115112c1d3790c839bd5a">&#9670;&nbsp;</a></span>send() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void httpsserver::WebsocketHandler::send </td>
          <td>(</td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>sendType</em> = <code>SEND_TYPE_BINARY</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send data down the web socket See the WebSocket spec (RFC6455) section "6.1 Sending Data". We build a WebSocket frame, send the frame followed by the data. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The data to send down the WebSocket. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sendType</td><td>The type of payload. Either SEND_TYPE_TEXT or SEND_TYPE_BINARY. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a2711aa6a22c4218596f30681a993b297"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2711aa6a22c4218596f30681a993b297">&#9670;&nbsp;</a></span>send() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void httpsserver::WebsocketHandler::send </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>sendType</em> = <code>SEND_TYPE_BINARY</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send data down the web socket See the WebSocket spec (RFC6455) section "6.1 Sending Data". We build a WebSocket frame, send the frame followed by the data. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The data to send down the WebSocket. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sendType</td><td>The type of payload. Either SEND_TYPE_TEXT or SEND_TYPE_BINARY. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/home/frank/Projekte/esp32/https_server/esp32_https_server/src/<a class="el" href="WebsocketHandler_8hpp_source.html">WebsocketHandler.hpp</a></li>
<li>/home/frank/Projekte/esp32/https_server/esp32_https_server/src/WebsocketHandler.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacehttpsserver.html">httpsserver</a></li><li class="navelem"><a class="el" href="classhttpsserver_1_1WebsocketHandler.html">WebsocketHandler</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
